package gooner.suntine.ssh.eg.service;

import gooner.suntine.ssh.eg.dao.StudentDao;
import gooner.suntine.ssh.eg.entity.Student;

import java.util.List;


/**
 * @corporation 
 * @author suntine
 * @creation 2011-5-5 10:25:00 AM
 * @description 
 */
public class StudentServiceImpl implements StudentService {
	

	private StudentDao dao;
	
	public void setDao(StudentDao dao) {
		this.dao = dao;
	}
	
	public List<Student> searchStudent(String hql){
		return dao.queryByHql(hql);
	}
	
	public Student getStudentById(int id){
		return dao.get(id);
	}
	
	public void createStudent(Student student){
		dao.save(student);
	}
	
	public void updateStudent(Student student){
		dao.update(student);
	}
	
	public void deleteStudentById(int id){
		dao.deleteById(id);
	}
}
